<?php
if (!defined('WY_ROOT')) exit;


class shownews extends Wy_Controller
{
    function __construct(){
        parent::__construct();
    }
    function index() {
        $id=$_GET["id"];
		if(!$id){
		  echo "非法操作";
		  exit;	
		}
		$news_info=$this->model("wechart")->fetch_one("news","id=".$id);
		//查询当前新闻的分类
		$news_class=$this->model("wechart")->fetch_one("newsclass","id=".$news_info['classid']);
		//查询所有分类
		$news_class_list=$this->model("wechart")->fetch_all("newsclass");
        $this->assign('news_info', $news_info);
		$this->assign('title',$news_class['classname']);
        $this->getView('shownews.php')->outPut();
    }
    
} ?>